/**
 * Owner Detail page script
 */

function validation()
{
	var ssn = document.forms["vechilDetail"]["ssn"].value;
	var drv = document.forms["vechilDetail"]["drivingLicence"].value;
	if(ssn=="")
	{
		document.getElementById('ssnNo').innerHTML='SSN should not be empty';
		return false;
		}

	  // allow only letters, numbers, and underscores
	    var i = /[\W_]/;
	    if(i.test(ssn))
	    {
		   
	    	document.getElementById('ssnNo').innerHTML = 'The SSN contains illegal characters';
            return false;
		    } 
	    //alert(ssn.length);
	     else if(ssn.length!=6)
	    {
		    //alert(ssn.length);
	    	document.getElementById('ssnNo').innerHTML = 'The SSN must be of 6 characters';
		    }
	     else
	    {
	    	document.getElementById('ssnNo').innerHTML = '';
		    }
	  

	    if(drv=="")
		{
			document.getElementById('driving').innerHTML='Driving Licence should not be empty';
			return false;
			}
	    if(drv.length!=6)
		{
			document.getElementById('driving').innerHTML='Driving Licence must be of 6 characters';
			return false;
			}

		  // allow only letters, numbers, and underscores
		   
		    if(i.test(drv))
		    {
			   
		    	document.getElementById('driving').innerHTML = 'The Driving Licence contains illegal characters';
	            return false;
			    } 
		    //document.getElementById('val').innerHTML = '';

return true;
	}
